#define _CRT_SECURE_NO_WARNINGS 1

#include "game.h"

void game()
{
	char mine[ROWS][COLS] = { 0 };
	char show[ROWS][COLS] = { 0 };

	//初始化棋盘
	Initialize(mine, ROWS, COLS, '0');
	Initialize(show, ROWS, COLS, '*');

	//埋雷
	SetTNT(mine, ROW, COL);

	//排查雷
	InvestigateTNT(mine, show, ROW, COL);

	//打印棋盘
	Print(mine,ROW,COL);
}

void menu()
{
	printf("****************\n");
	printf("*****1 play*****\n");
	printf("*****0 exit*****\n");
	printf("****************\n");
}

void test()
{
	int n = 0;
	do
	{
		menu();
		printf("请选择->:");
		scanf("%d", &n);
		switch (n)
		{
		case 1:
			//开始游戏
			game();
			break;
		case 0:
			//退出游戏
			printf("游戏结束，退出游戏！！！\n");
			break;
		default:
			printf("非法选择，请重新选择！！！\n");
			break;
		}
	} while (n);
}

int main()
{
	srand((unsigned int)time(NULL));
	test();
	return 0;
}